local jufen = fk.CreateSkill{
  name = "xiaobai__jufen",
}
jufen:addEffect("active",{
  anim_type = "offensive",
  prompt = "你可以对自己造成1点火焰伤害，然后获得本回合进入弃牌堆的所有牌。",
  frequency = Skill.Limited,
  can_use = function(self, player)
    return player:usedSkillTimes(jufen.name, Player.HistoryGame) == 0 and
           #player:getCardIds("h") == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    room:damage({
      from = player,
      to = player,
      damage = 1,
      damageType = fk.FireDamage,
      skillName = jufen.name,
    })
    if player.dead then return end
    local cards = {}
    room.logic:getEventsOfScope(GameEvent.MoveCards, 1, function(e)
      for _, move in ipairs(e.data) do
        if move.toArea == Card.DiscardPile then
          for _, info in ipairs(move.moveInfo) do
            table.insertIfNeed(cards, info.cardId)
          end
        end
      end
    end, Player.HistoryTurn)
    cards = table.filter(cards, function (id)
      return table.contains(room.discard_pile, id)
    end)
    room:moveCards({
      ids = cards,
      toArea = Card.PlayerHand,
      to = player.id,
      moveReason = fk.ReasonPrey,
      skillName = jufen.name,
    })
  end,
})

Fk:loadTranslationTable{
  ["xiaobai__jufen"] = "俱焚",
  [":xiaobai__jufen"] = "限定技，出牌阶段，若你没有手牌，你可以对自己造成1点火焰伤害，然后获得本回合进入弃牌堆的所有牌。",
  ["$xiaobai__jufen1"] = "含垢忍耻丈夫事，殉死国难女子亦可为。",
  ["$xiaobai__jufen2"] = "节可成不可毁，玉可焚不可辱。",
}

return jufen